﻿@model BlackBox.Controllers.GameViewModel


<div id="game-page">
    <p>
        <a href="~/Home/Main">Home</a>
            > 
        <a href="~/Game/PlayGame">Play Game</a>
            >
        <a href="~/Game/Category/@Model.CategoryData.id">@Model.CategoryData.categorytitle</a>
    </p>
    <div id="game-information">
        <h2>@Model.GameData.name </h2>
        <img src="@Model.GameData.image" alt="Game Image"/>
        <div class="rating">
            <p>Rating: @Model.GameData.rating</p> 
            @if(Model.RatingData == null)
            {
                using (Html.BeginForm("Rate", "Game", FormMethod.Post, new { enctype = "multipart/form-data" }))

                {
                @Html.DropDownListFor(model => Model.RatingData.Rating, ViewData["Ratings"] as List<SelectListItem>)
                @Html.HiddenFor(model => Model.UserData.UserId)
                @Html.HiddenFor(model => Model.GameData.id)
                <p>
                    <input type="submit" value="Rate" />
                </p>
                }
            }
            else
            {
                <p>Game Rated</p>
            }
        </div>
	    <p>@Model.GameData.description</p>
    </div>
    <div id="game-buttons">
        <a href="~/Game/JoinGame/@Model.GameData.id">Join Game</a> 
        <a href="~/Game/CreateGame/@Model.GameData.id">Host Game</a>
    </div>
</div>